<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>电视故障效果</title>
    <style>
      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }

      /* 背景 */
      body {
        background-color: #333;
        overflow: hidden; /* 防止页面出现滚动条 */
      }

      /* 整个页面容器 */
      .static-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        pointer-events: none; /* 不干扰用户的交互 */
      }

      /* 故障线的基本样式 */
      .line {
        position: absolute;
        width: 100%;
        height: 2px;
        background-color: rgba(255, 255, 255, 0.8);
        opacity: 0;
        animation: glitch-animation 0.5s infinite;
      }

      /* 不同线条的不规则位置和时间延迟 */
      .line:nth-child(odd) {
        animation-duration: 0.6s;
        animation-delay: -0.3s;
      }

      .line:nth-child(even) {
        animation-duration: 0.4s;
        animation-delay: -0.1s;
      }

      /* 故障线的动画效果 */
      @keyframes glitch-animation {
        0% {
          transform: translateX(0) skewX(0deg);
          opacity: 0.8;
        }
        20% {
          transform: translateX(-10px) skewX(-10deg);
          opacity: 1;
        }
        40% {
          transform: translateX(10px) skewX(10deg);
          opacity: 0.8;
        }
        60% {
          transform: translateX(-5px) skewX(-5deg);
          opacity: 1;
        }
        80% {
          transform: translateX(5px) skewX(5deg);
          opacity: 0.8;
        }
        100% {
          transform: translateX(0) skewX(0deg);
          opacity: 0.8;
        }
      }
    </style>
  </head>
  <body>
    <div class="static-container">
      <!-- 创建多条故障线 -->
      <div class="line" style="top: 10%"></div>
      <div class="line" style="top: 20%"></div>
      <div class="line" style="top: 30%"></div>
      <div class="line" style="top: 40%"></div>
      <div class="line" style="top: 50%"></div>
      <div class="line" style="top: 60%"></div>
      <div class="line" style="top: 70%"></div>
      <div class="line" style="top: 80%"></div>
      <div class="line" style="top: 90%"></div>
    </div>
  </body>
</html>
